<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head id="MyHead">
    <script src="../resources/Scripts/jquery.min.js" type="text/javascript"></script>
    <script src="../resources/Scripts/JScriptIndex.js" type="text/javascript"></script>
    <script src="../resources/Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../resources/Scripts/easyui-lang-zh_CN.js" type="text/javascript"></script>
    <link href="../resources/css/themes/default/easyui.css" rel="stylesheet"
        type="text/css" />
    <link href="../resources/Content/Default.css" rel="stylesheet" type="text/css" />
    <link href="../resources/css/themes/icon.css" rel="stylesheet"
        type="text/css" />
    <link href="../resources/Content/IndexStyle.css" rel="stylesheet" type="text/css" />
    <title>科目一理论考试</title>
    <base target = "_self">
</head>
<script type="text/javascript" language="javascript">
             $(function () {
             $.extend($.fn.datagrid.methods, {
                 addToolbarItem: function (jq, items) {
                     return jq.each(function () {
                         var dpanel = $(this).datagrid('getPanel');
                         var toolbar = dpanel.children("div.datagrid-toolbar");
                         if (!toolbar.length) {
                             toolbar = $("<div class=\"datagrid-toolbar\"><table cellspacing=\"0\" cellpadding=\"0\"><tr></tr></table></div>").prependTo(dpanel);
                             $(this).datagrid('resize');
                         }
                         var tr = toolbar.find("tr");
                         for (var i = 0; i < items.length; i++) {
                             var btn = items[i];
                             if (btn == "-") {
                                 $("<td><div class=\"datagrid-btn-separator\"></div></td>").appendTo(tr);
                             } else {
                                 var td = $("<td></td>").appendTo(tr);
                                 var b = $("<a href=\"javascript:void(0)\"></a>").appendTo(td);
                                 b[0].onclick = eval(btn.handler || function () { });
                                 b.linkbutton($.extend({}, btn, {
                                     plain: true
                                 }));
                             }
                         }
                     });
                 },
                 removeToolbarItem: function (jq, param) {
                     return jq.each(function () {
                         var dpanel = $(this).datagrid('getPanel');
                         var toolbar = dpanel.children("div.datagrid-toolbar");
                         var cbtn = null;
                         if (typeof param == "number") {
                             cbtn = toolbar.find("td").eq(param).find('span.l-btn-text');
                         } else if (typeof param == "string") {
                             cbtn = toolbar.find("span.l-btn-text:contains('" + param + "')");
                         }
                         if (cbtn && cbtn.length > 0) {
                             cbtn.closest('td').remove();
                             cbtn = null;
                         }
                     });
                 }
             });
         });
       

       $(function () {
            var currTab = window.top.$('#tabs').tabs('getSelected'); //获得当前tab
            var iframeid = $(currTab.panel('options').content).attr('id');

                       //关闭AJAX相应的缓存
                $.ajaxSetup({
                    cache: false
                });

                $.getJSON("../../../Home/GetToolbar", { id: iframeid }, function (data) {

                    if (data == null) {
                        return;
                    }
                    $('#flexigridData').datagrid("addToolbarItem", data);

                });


            $('#flexigridData').datagrid({
              //  title: '科目一理论', //列表的标题
                iconCls: 'icon-site',
                width: 'auto',
                height: 'auto',
                nowrap: true,
                striped: true,
                collapsible: true,
                url: '/GetData', //获取数据的url
                queryParams: { exaSubject: '科目一理论' },
                sortName: 'PK_id',
                sortOrder: 'desc',
                idField: 'PK_id',
                singleSelect: true,
                toolbar: [
						{
						    text: '查询',
						    iconCls: 'icon-search',
						    handler: function () {
						        return flexiQuery();
						    }
						}, "-", {
						    text: '创建',
						    iconCls: 'icon-add',
						    handler: function () {
						        return flexiCreate();
						    }
						}, "-", {
						    text: '确认成绩',
						    iconCls: 'icon-search',
						    handler: function () {
						        return getView();
						    }
						}, "-", {
						    text: '考试归档',
						    iconCls: 'icon-ok',
						    handler: function () {
						        return ksGuidang();
						    }
						}   
                   ],
                   onDblClickRow:onDblClickRow,
                columns: [[


					{ field: 'exaId', title: '<label for="exaId">考试编号</label>', width: 86 }
					, { field: 'exaSubject', title: '<label for="exaSubject">科目</label>', width: 66 }
					, { field: 'exaName', title: '<label for="exaName">考试名称</label>', width: 150 }
					, { field: 'exaTime', title: '<label for="exaTime">考试时间</label>', width: 76
/*                     , formatter: function (value, rec) {
                        if (value) {
                            return dateConvert(value);
                        }
                    } */
					},
					/*      { field: 'exaActiveTime', title: '<label for="exaActiveTime">归档时间</label>', width: 76
                    , formatter: function (value, rec) {
                        if (value) {
                            return dateConvert(value);
                        }
                    } 
                    }
                    ,{ field: 'exaFinance', title: '同步财务', width: 66}
                    ,*/
                { field: 'exaActiveStatus', title: '<label for="exaActiveStatus">归档状态</label>', width: 66}
                     
				, { field: 'exaPrincipal', title: '<label for="exaPrincipal">负责人</label>', width: 60 }
//                ,{ field: 'TE_num', title: '<label for="TE_num">考试人数</label>',align:'right', width: 76 }
                  ,{ field: 'exaExamination', title: '已报考', width: 60,align:'right'}
                  ,{ field: 'exaParticipate', title: '已参加', width: 60 ,align:'right'}
                  ,{ field: 'exaQualified', title: '已合格', width: 60 ,align:'right'}
                  ,{ field: 'exaPassrate', title: '合格率', width: 60 ,align:'right'}
					, { field: 'exaDescription', title: '<label for="exaDescription">考试说明</label>', width: 120 }
				

                ]],
                pagination: true,
                rownumbers: true

            });


        });

        //“查询”按钮，弹出查询框
        function flexiQuery() {
            $('#divQuery').dialog({
                buttons: [{
                    text: '查询',
                    iconCls: 'icon-ok',
                    handler: function () {
                        //将查询条件按照分隔符拼接成字符串
                        var search = "";
                        /* $('#divQuery').find(":text,:selected,select,textarea,:hidden,:checked,:password").each(function () {
                            var hidtreeid = '201301301444110156250c451035ec5';
                            if (hidtreeid != null && hidtreeid != "undefined" && hidtreeid!="") {

                                search = "FK_TSID&" + hidtreeid + "^";
                            }
                            search = search + this.id + "&" + this.value + "^";
                        }); */
                        //执行查询                        
                        $('#flexigridData').datagrid('reload', {exaSubject:'科目一理论',exaId:$("#exaId").textbox('getValue'),exaName:$("#exaName").textbox('getValue')});
                    }
                },
                     {
                         text: '取消',
                         iconCls: 'icon-cancel',
                         handler: function () {
                             $('#divQuery').dialog("close");
                         }
                     }]
            });
            $('#divQuery').dialog("open");
        };

//        //受理报考名单
//        function shouliBaokao(){
//        
//        }


        //设置挂账
        function SetCredit() {


            var arr = $('#flexigridData').datagrid('getSelections');

            if (arr.length == 1) {
                //window.location.href = "../S_Should/ShouldList/" + arr[0].PK_ID;
                window.parent.showMyWindow("挂账", "/T_should/SetCredit/" + arr[0].PK_id + "?rd=" + Math.random(), 800, 600, true, false, true);

            } else {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
            }
            return false;
        
        }

                function onDblClickRow(rowIndex, rowData){
            //var selected = $("#flexigridData").datagrid('getSelections'); //获取所有行集合对象
            //var obj = selected[rowIndex]; //index为当前右键行的索引，指向当前行对象
            parent.addTab("提交报考:" + rowData["TE_title"], "conditions_applicants.html" /* + rowData["PK_id"], "tu1001", true, rowData["PK_id"] */);
        }

        //选择学员
//        function SelStudent() { 

//            var rows = $('#flexigridData').datagrid('getSelections');
//            if (rows.length == 1) {
//                //window.location.href = "../S_Should/ShouldList/" + arr[0].PK_ID;
//                //window.parent.showMyWindow("选择学员", "/T_apply/SelStudent/" + arr[0].PK_id + "?rd=" + Math.random(), 1000, 600, true, false, true, "yes");
//                parent.addTab("提交报考:" + rows[0].TE_title, "../../../T_apply/SelStudent/" + rows[0].PK_id, "tu1001", true, rows[0].PK_id);
//            } else {
//                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
//            }
//            return false;
//        
//        }
        //“选择”按钮，在其他（与此页面有关联）的页面中，此页面以弹出框的形式出现，选择页面中的数据
        function flexiSelect() {

            var rows = $('#flexigridData').datagrid('getSelections');
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }

            var arr = [];
            for (var i = 0; i < rows.length; i++) {
                arr.push(rows[i].PK_id);
            }
            arr.push("^");
            for (var i = 0; i < rows.length; i++) {
                arr.push(rows[i].TE_NO);
            }
            //主键列和显示列之间用 ^ 分割   每一项用 , 分割
            if (arr.length > 0) {//一条数据和多于一条
                returnParent(arr.join("&")); //每一项用 & 分割
            }
        }
        //导航到查看详细的按钮
        function getView() {
            var arr = $('#flexigridData').datagrid('getSelections');
            if (arr.length == 1) {
                window.location.href = "/enrolled_students_list.html?exaId=" + arr[0].exaId+"&page=1&rows=10";
            } else {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
            }
            return false;
        }


        //导航到创建的按钮
        function flexiCreate() {

            window.location.href = "create.jsp";
            return false;
        }
        //导航到修改的按钮
        function flexiModify() {

            var arr = $('#flexigridData').datagrid('getSelections');

            if (arr.length == 1) {
                window.location.href = "../../T_exam/Edit/" + arr[0].PK_id+"?E_id=201301301444110156250c451035ec5";

            } else {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
            }
            return false;

        };
        //删除的按钮
        function flexiDelete() {

            var rows = $('#flexigridData').datagrid('getSelections');
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }

            var arr = [];
            for (var i = 0; i < rows.length; i++) {
                arr.push(rows[i].PK_id);
            }

            $.messager.confirm('操作提示', "确认删除这 " + arr.length + " 项吗？", function (r) {
        
                if (r) {
                    $.post("../../T_exam/Delete", { query: arr.join(",") }, function (res) {
                        if (res == "OK") {
                            //移除删除的数据

                            $.messager.alert('操作提示', '删除成功!', 'info');
                            $("#flexigridData").datagrid("reload");
                            $("#flexigridData").datagrid("clearSelections");
                        }
                        else {
                            if (res == "") {
                                $.messager.alert('操作提示', '删除失败!请查看该数据与其他模块下的信息的关联，或联系管理员。', 'info');
                            }
                            else {
                                $.messager.alert('操作提示', res, 'info');
                            }
                        }
                    });
                }
            });

        };

        
        //车型参数设置
        function carParmSet(){
           
//            var rows = $('#flexigridData').datagrid('getSelections'); 

//            if (rows.length == 0) {
//                $.messager.alert('操作提示', '请选择数据!', 'warning');
//                return false;
//            }
                  //var search = 'bc_pk_id&^';
        $("#carParmData").datagrid("clearSelections");
        $('#carParmData').datagrid({
            iconCls: 'icon-site',
            width: 'auto',
            height: 'auto',
            nowrap: true,
            striped: true,
            collapsible: true,
            singleSelect: false,
            url: '../../../T_Sub_Parames/ParamesList', //获取数据的url
            queryParams: { t_id: '201301301444110156250c451035ec5' },
            idField: 'pk_id',
            toolbar: [
                        {
                text: '保存修改',
                iconCls: 'icon-edit',
                handler: function () {
                    return saveUpdate();
                } 
            }],
                    onClickRow: onClickRow,
            columns: [[
                { field: 'ck', checkbox: true },
                   { field: 'car_id', title: '准驾车型', width:60}
                   , { field: 'tsp_yesday', title: '支队受理通过天数', width: 100, editor:{type:'numberbox'}}
                   , { field: 'tsp_noday', title: '科一未通过天数', width: 100, editor:{type:'numberbox'}}
                   , { field: 'yixuexueshi', title: '科一已学学时', width: 115, editor:{type:'numberbox'}}
                     ,{field:'baokaofei',title:'科目一理论报考费',width: 120,editor:{type:'numberbox'},options:{value:0,precision:2,min:0,groupSeparator:','},formatter: function (value, rec) {return formatCurrency(value);}},{field:'bukaofei',title:'科目一理论补考费',width: 120,editor:{type:'numberbox'},options:{value:0,precision:2,min:0,groupSeparator:','},formatter: function (value, rec) {return formatCurrency(value);}}
                  
                ]],
            pagination: false,
            rownumbers: true

        });

        $('#carParmSet').window('open');

        }

       

        //保存修改
        function saveUpdate() {
        if(endEditing("carParmData"))
        {
           $('#carParmData').datagrid('acceptChanges');

            var rows = $('#carParmData').datagrid('getChecked'); 

            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }
            var ids=[];
            var nodays=[];
            var yesdays=[];
            var baokaofei=[];
            var bukaofei=[];
            var yixuexueshi=[];
            for(var i=0;i<rows.length;i++)
            {
                ids.push(rows[i].pk_id);
                nodays.push(rows[i].tsp_noday);
                yesdays.push(rows[i].tsp_yesday);
                baokaofei.push(rows[i].baokaofei);
                bukaofei.push(rows[i].bukaofei);
                yixuexueshi.push(rows[i].yixuexueshi);
            }
            if (rows.length>0) {

            $.messager.confirm('操作提示', "确认要保存这 " + rows.length + " 项吗？", function (r){
                if(r)
                {

                    $.ajax({
                    type:"POST",
                    url: "../../../T_Sub_Parames/saveUpdate",
                    data: { ids:ids.join(","),subid:'201301301444110156250c451035ec5',nodays: nodays.join(","), yesdays: yesdays.join(","),baokaofei:baokaofei.join(","),bukaofei:bukaofei.join(","),yixuexueshi:yixuexueshi.join(",")},
                    success: function () {
                        $.messager.alert('操作提示', '保存修改成功!', 'info');
                        $("#carParmData").datagrid("reload");
                        $("#carParmData").datagrid("clearSelections");
                    }
                });

                }
             });



            }
        }
        }


		
var editIndex = undefined;
        function endEditing(obj){
            if (editIndex == undefined){return true}
            if ($('#' + obj).datagrid('validateRow', editIndex)){
               //var ed = $('#carParmData').datagrid('getEditor', {index:editIndex,field:'pk_id'});
               //var productname = $(ed.target).combobox('getText');
                //$('#carParmData').datagrid('getRows')[editIndex]['productname'] = productname;
               $('#' + obj).datagrid('endEdit', editIndex);
             editIndex = undefined;
               return true;
           } else {
               return false;
           }
      }
       function onClickRow(index){
            endEditing("carParmData");
          if (editIndex != index){
               if (endEditing("carParmData")){
                   $('#carParmData').datagrid('selectRow', index)
                          .datagrid('beginEdit', index);
                    editIndex = index;
               } else {
                   $('#carParmData').datagrid('selectRow', editIndex);
               }
           }
        }



//        //考试名额分配
//        var examID="";
//        function examFenpei(){
//            
//             var rows = $('#flexigridData').datagrid('getSelections'); 

//            if (rows.length == 0) {
//                $.messager.alert('操作提示', '请选择数据!', 'warning');
//                return false;
//            }
//            else if(rows.length >1){
//                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
//                return false;
//            }
//            examID=rows[0].PK_id;

//            $("#Places").datagrid("clearSelections");
//            $('#Places').datagrid({
//            iconCls: 'icon-site',
//            width: 'auto',
//            height: 'auto',
//            nowrap: true,
//            striped: true,
//            collapsible: true,
//            singleSelect: false,
//            url: '../../../T_ExamPlaces/ExamPlacesList', //获取数据的url
//            queryParams: { examID: examID },
//            idField: 'pk_id',
//            toolbar: [
//                        {
//                text: '保存修改',
//                iconCls: 'icon-edit',
//                handler: function () {
//                    return savePlaces();
//                } 
//            }
//            ,"-",{
//                text: '全部提交总校',
//                iconCls: 'icon-edit',
//                handler: function () {
//                    return allSubmit();
//                } 
//            },"-"
//            ,{text:'[<font color="green">计划总名额：<span id="zongminge"></span></font>] [<font color="green">已报计划：<span id="jihua"></span></font>] [<font color="green">已报备用：<span id="beiyong"></span></font>]'}
//                    ],
//                    onClickRow: onClickRowPlaces,
//            columns: [[
//            { field: 'ck', checkbox: true },
//                   { field: 'fenxiao_id', title: '分校名称', width: 100, sortable: true}
//                   , { field: 'tep_number', title: '计划名额', width: 70, sortable: true ,editor:{type:'numberbox'}}
//                   , { field: 'tep_number2', title: '计划已报', width: 70, sortable: true }
//                   , { field: 'tep_number1', title: '备用名额', width: 70, sortable: true ,editor:{type:'numberbox'}}
//                   , { field: 'tep_number3', title: '备用已报', width: 70, sortable: true }
//                   , { field: 'iszongxiao', title: '提交总校', width: 70,align:'center',editor:{type:'checkbox',options:{on:'是',off:'否'}}}
//                   
//                ]],
//            pagination: false,
//            rownumbers: true});
//            $("#zongminge").text(rows[0].TE_num);
//            getBaokaoNum();
//            $('#ExamPlaces').window('open');

//        }
//        function querenBaokao(){}

//        function getBaokaoNum(){
//            $.post("../../T_apply/getBaokaoNum",{ksid:examID},function(res){
//                 $("#jihua").text(res["jihua"]);
//                $("#beiyong").text(res["beiyong"]);
//            });

//        }

                //保存修改
        function savePlaces() {

        endEditing("Places");
        $('#Places').datagrid('acceptChanges');

        //判断总数
        var zongminge=$("#zongminge").text();
        var rows1=$("#Places").datagrid('getRows');
        var getzme=0,getbys=0;
        for(var i=0;i<rows1.length;i++)
        {
            getzme+=Number(rows1[i].tep_number);
            getbys+=Number(rows1[i].tep_number1);
        }
        //alert(getbys);
        if(getzme>zongminge)
        {
            $.messager.alert('操作提示', '计划名额数超出总名额数，请核对!', 'warning');
            return false;
        }

         if(getbys>zongminge)
        {
            $.messager.alert('操作提示', '备用名额数超出总名额数，请核对!', 'warning');
            return false;
        }

            var rows = $('#Places').datagrid('getChecked'); 

            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }
            var ids=[];
            var numbers=[];
            var number1s=[];
            var iszongxiao=[];
            for(var i=0;i<rows.length;i++)
            {
                ids.push(rows[i].pk_id);
                numbers.push(rows[i].tep_number);
                number1s.push(rows[i].tep_number1);
                var iszx='0';
                if(rows[i].iszongxiao=='是')
                {
                    iszx='1';
                }
                iszongxiao.push(iszx);
            }
            //alert(iszongxiao.join(','));
            if (rows.length>0) {

                        $.messager.confirm('操作提示', "确认要保存这 " + rows.length + " 项吗？", function (r){
                if(r){
                
                

                $.ajax({
                    type:"POST",
                    url: "../../../T_ExamPlaces/savePlaces",
                    data: { ids:ids.join(","),examID:examID,numbers: numbers.join(","), number1s: number1s.join(","),iszongxiao:iszongxiao.join(',')},
                    success: function () {
                        $.messager.alert('操作提示', '保存修改成功!', 'info');
                        $("#Places").datagrid("reload");
                        $("#Places").datagrid("clearSelections");
                    }
                });

                    }
                });
            }
        }


               function onClickRowPlaces(index){
               endEditing("Places");
          if (editIndex != index){
               if (endEditing("Places")){
                   $('#Places').datagrid('selectRow', index)
                          .datagrid('beginEdit', index);
                    editIndex = index;
               } else {
                   $('#Places').datagrid('selectRow', editIndex);
               }
           }
        }

//        function shouliBaokao(){
//                        var rows = $('#flexigridData').datagrid('getSelections');
//            if (rows.length == 1) {
//                //window.location.href = "../S_Should/ShouldList/" + arr[0].PK_ID;
//                //window.parent.showMyWindow("选择学员", "/T_apply/SelStudent/" + arr[0].PK_id + "?rd=" + Math.random(), 1000, 600, true, false, true, "yes");
//                parent.addTab("受理报考：" + rows[0].TE_title, "../../../T_apply/SelStudent1/" + rows[0].PK_id, "tu1001", true, rows[0].PK_id);
//            } else {
//                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
//            }
//            return false;
//        }


              //考试归档
       function ksGuidang()
       {
            var rows = $('#flexigridData').datagrid('getSelections');
            if (rows.length == 0) {
                $.messager.alert('操作提示', '请选择数据!', 'warning');
                return false;
            }

             $('#divUpQuery').dialog({
                    buttons: [{
                        text: '保存',
                        iconCls: 'icon-ok',
                        handler: function () {
                            var gdStatus =$("input[name='gdStatus']:checked").val();
                            var gdTime=$("#gdTime").val();

                            if (gdStatus == "") {
                                $.messager.alert('操作提示', '请选择归档状态!', 'info');
                                return false;
                            }
                            if(gdTime=="")
                            {
                                $.messager.alert('操作提示', '请选择归档日期!', 'info');
                            }
                                $.messager.confirm('操作提示', "确认保存操作项吗？", function (r) {
                                if (r) {

                                    $.post("../../T_exam/ksGuidang", { pkid: rows[0].PK_id, gdStatus: gdStatus,gdTime:gdTime }, function (res) {

                                        if (res == "OK") {
                                            //移除删除的数据
                                            $('#divUpQuery').dialog("close");
                                            $.messager.alert('操作提示', '操作成功!', 'info');

                                            $("#flexigridData").datagrid("reload");
                                            $("#flexigridData").datagrid("clearSelections");

                                        }
                                        else {
                                                $.messager.alert('操作提示', res, 'info');
                                        }
                                    });
                                }
                            });

                        }

                    },
                     {
                         text: '取消',
                         iconCls: 'icon-cancel',
                         handler: function () {
                             $('#divUpQuery').dialog("close");
                         }
                     }]
                });
                $('#divUpQuery').dialog("open");
                //****************
       }

       function allSubmit(){
        $.messager.confirm('操作提示', "确认要全部提交总校吗？", function (r){
                if(r){
                
                

                $.ajax({
                    type:"POST",
                    url: "../../../T_ExamPlaces/allSubmit",
                    data: {ksid:examID},
                    success: function (res) {
                     if(res=="OK")
                     {
                        $.messager.alert('操作提示', '保存修改成功!', 'info');
                        $("#Places").datagrid("reload");
                        $("#Places").datagrid("clearSelections");
                     }
                     else{
                        $.messager.alert('操作提示', res, 'info');
                     }

                    }
                });

                    }
                });
       }

              //提交总校操作
       function querenBaokao() {
           var rows = $('#flexigridData').datagrid('getSelections');
           if (rows.length == 1) {



               if (isSubmitZx(rows[0].PK_id) == 1) {
                   $.messager.alert('操作提示', '报考已经提交总校!', 'warning');
                   return false;
               }

               $.messager.confirm('操作提示', "提交总校后不能再进行提交报考和取消报考，请核对无误后再确认？", function (r) {
                   if (r) {
                       $.post("../../T_ExamPlaces/tijiaozongxiao", { ksid: rows[0].PK_id }, function (res) {
                           if (res == "OK") {
                               //移除删除的数据
                               $.messager.alert('操作提示', '提交总校成功!', 'info');
                           }
                           else {
                               $.messager.alert('操作提示', res, 'info');
                           }
                       });
                   }
               });
           }
           else {
               $.messager.alert('操作提示', '请选择一条数据!', 'warning');
               return false;
           }
       }


       function isSubmitZx(ksid) {
                    var bb=0;
            $.ajax({type:"POST",async:false,cache:false,url:"../../T_ExamPlaces/isSubmitZx",data:"ksid=" + ksid,success:function(res){
                //alert(res);
                bb=res;
            }});
            return bb;
        }

         function qrcj(){
                        var rows = $('#flexigridData').datagrid('getSelections');
            if (rows.length == 1) {
                //window.location.href = "../S_Should/ShouldList/" + arr[0].PK_ID;
                //window.parent.showMyWindow("选择学员", "/T_apply/SelStudent/" + arr[0].PK_id + "?rd=" + Math.random(), 1000, 600, true, false, true, "yes");
               
               parent.addTab("确认成绩：" + rows[0].TE_title, "../../../T_apply/SelStudent1/" + rows[0].PK_id, "tu1001", true, rows[0].PK_id);
            } else {
                $.messager.alert('操作提示', '请选择一条数据!', 'warning');
            }
            return false;
        }
        

    </script>
    <body >
    
  
<div fit="true" class="easyui-layout" style=" padding:5px;">
    <table id="flexigridData" fit="true">
    </table>
    </div>
    <div id="divQuery" title="查询列表" class="easyui-dialog" closed="true" modal="false"
        iconcls="icon-search">
         
            <div class="input">
                <div class="editor-label-search">
                    <label for="exaId">考试编号</label>
                </div>
                <div class="editor-field-search">
                    <input class="easyui-textbox" name='exaId' type='text' id='exaId'/>
                </div>
            </div> 
            <div class="input">
                <div class="editor-label-search">
                    <label for="exaName">考试名称</label>
                </div>
                <div class="editor-field-search">
                    <input class="easyui-textbox" name='exaName' type='text' id='exaName'/>
                </div>
            </div>
    </div>
    <div id="dialo" title="操作">
    </div>
        <input id="hidtreeid" type="hidden" />
    <input id="SysMenuIdOld" type="hidden" />
    
    <div id="carParmSet" class="easyui-dialog" title="准驾车型考试条件设置" closed="true"  collapsible="false" minimizable="false" maximizable="false" modal="true" data-options="iconCls:'icon-save'" style="width:680px;height:420px;padding:5px;">
      <table class="easyui-datagrid" id="carParmData" border="true" fit="true"></table>
    </div>
    <div id="ExamPlaces" class="easyui-dialog" title="各分校考试名额分配" closed="true"  collapsible="false" minimizable="false" maximizable="false" modal="true" data-options="iconCls:'icon-save'" style="width:650px;height:480px;padding:5px;">
      <table class="easyui-datagrid" id="Places" border="true" fit="true"></table>
    </div>

<div id="divUpQuery" title="归档状态" class="easyui-dialog" closed="true" modal="true"
        iconcls="icon-search" style="width:250px; height:160px; text-align:center;">
        <br />
      归档状态：
    <input type="radio"  value="1" checked="checked" name="gdStatus"/>归档
    <input type="radio"  value="0" name="gdStatus"/>取消归档
<br /><br />
归档日期：<input type="text" id="gdTime" value="2018-01-17" onclick = "WdatePicker()" size="10" />
    </div>
</body>
</html>
